/**
 * tjftp -- A simple FTP server, using the ANSI C
 * Copyright (C) 2011  degui.chen <degui.chen@qq.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef MEMORY_H
#define MEMORY_H

#define tj_memory_alloc(size) _tj_memory_alloc(size, __FILE__, __FUNCTION__, __LINE__, __STDC__)
#define tj_memory_free(lp) _tj_memory_free(lp, __FILE__, __FUNCTION__, __LINE__, __STDC__)

void tj_memory_debug();
void* _tj_memory_alloc(int size, const char* file, const char* fun, int line, int ansi_c);
void _tj_memory_free(void* lp, const char* file, const char* fun, int line, int ansi_c);

char* tj_memory_index_char(char* str, char key);
char* tj_memory_index_string(char* string, char* key, int position);
int tj_memory_compare(const void *s1, const void *s2, size_t length);
void tj_memory_copy(void *dest, const void *src, size_t length);
void tj_memory_move(void * dest, const void * src, size_t length);
void tj_memory_clear(char* str, int length);

#endif /* MEMORY_H */
